POV-Ray : Newsgroups : povray.general : Parsing question... : Re: Parsing question... Server Time
5 Aug 2024 18:25:06 EDT (-0400)
  Re: Parsing question...  
From: TinCanMan
Date: 7 Aug 2002 12:15:04
Message: <3d514788@news.povray.org>
"Warp" <war### [at] tagpovrayorg> wrote in message
news:3d50449e@news.povray.org...
> Tim Nikias <tim### [at] gmxde> wrote:
> > What is actually easier for POV to parse,
> > (Float_Value*2) or (Float_Value+Float_Value)?
>
>   I don't think there's any difference.
>   In fact, I think that the former could be faster because a short
constant
> is probably faster to parse than a long identifier name (with the proper
> value lookup involved).

I tried a quick test, I ran through 100,000 iterations of each method in
POV, 10 times each with these results (times include trace time but that
shouldn't affect the relative outcome):

A*2
Average: 12.323s
Median: 12.315s
Max: 12.72s
Min: 11.9s
Std Dev: 0.238097

A+A
Average: 11.380s
Median: 11.395s
Max: 11.57s
Min: 11.17s
Std Dev: 0.116046

I also ran each method once with 1,000,000 iterations (i know, poor sampling
size)
A*2: 93.52s
A+A: 89.00s

It would appear that addition is quicker, but perhaps someone else should do
an independent audit.
My machine: 466MHz, 320MB, WinXP

-tgq


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.